package com.fawvwebanma.dao;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.fawvwebanma.entity.Ticket;
import com.fawvwebanma.mapper.TicketMapper;

/**
 * @author jieye.ren
 * @date 2021/3/15
 */
@Component
public class TicketDao {
    @Autowired
    TicketMapper ticketMapper;

    public void updateTicketStatus(Ticket ticket, Map<String, Object> map) {
        UpdateWrapper<Ticket> updateWrapper = new UpdateWrapper<>();
        updateWrapper.allEq(map);
        ticketMapper.update(ticket, updateWrapper);
    }

    public void saveTickets(Ticket ticket) {
        ticketMapper.insert(ticket);
    }
}
